import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: HomeView,
    // redirect: '/index',
    children: [
      {
        path: '/permission/admin/add-new',
        component: () => import('../views/permission/AdminAddNewView')
      },
      {
        path: '/permission/admin',
        component: () => import('../views/permission/AdminListView')
      },
      {
        path: '/permission/role',
        component: () => import('../views/permission/RoleListView.vue')
      },
      {
        path: '/permission/role/add-new',
        component: () => import('../views/permission/RoleAddNewView.vue')
      },
      {
        path: '/house/section',
        component: () => import('../views/house/SectionListView')
      },
      {
        path: '/house/section/add-new',
        component: () => import('../views/house/SectionAddNewView')
      },
      {
        path: '/house/agent',
        component: () => import('../views/house/AgentListView.vue')
      },
      {
        path: '/house/agent/add-new',
        component: () => import('../views/house/AgentAddNewView.vue')
      },
      {
        path: '/permission/permission/add-new',
        component: () => import('../views/permission/PermissionAddNewView')
      },
      {
        path: '/permission/permission',
        component: () => import('../views/permission/PermissionListView')
      },
      {
        path: '/house/lease-house/add-new-1',
        component: () => import('../views/house/LeaseHouseAddNewView1')
      },
      {
        path: '/house/lease-house/add-new-2',
        component: () => import('../views/house/LeaseHouseAddNewView2')
      },
      {
        path: '/house/lease-house/update-1',
        component: () => import('../views/house/LeaseHouseUpdateInfoView1')
      },
      {
        path: '/house/lease-house/update-2',
        component: () => import('../views/house/LeaseHouseUpdateInfoView2')
      },
      {
        path: '/house/lease-house',
        component: () => import('../views/house/LeaseHouseListView')
      },
      {
        path: '/house/new-house/update-1',
        component: () => import('../views/house/NewHouseUpdateInfoView1')
      },
      {
        path: '/house/new-house/update-2',
        component: () => import('../views/house/NewHouseUpdateInfoView2')
      },
      {
        path: '/house/new-house/add-new-1',
        component: () => import('../views/house/NewHouseAddNewView1')
      },
      {
        path: '/house/new-house/add-new-2',
        component: () => import('../views/house/NewHouseAddNewView2')
      },
      {
        path: '/house/new-house',
        component: () => import('../views/house/NewHouseListView')
      },
      {
        path: '/house/second-hand-house/add-new-1',
        component: () => import('../views/house/SecondHandHouseAddNewView1')
      },
      {
        path: '/house/second-hand-house/add-new-2',
        component: () => import('../views/house/SecondHandHouseAddNewView2')
      },
      {
        path: '/house/second-hand-house',
        component: () => import('../views/house/SecondHandHouseListView')
      },
      {
        path: '/news/newsDetail',
        component: () => import('../views/news/NewsDetailListView.vue')
      },
      {
        path: '/news/newsDetail/standard',
        component: () => import('../views/news/NewsDetailStandardView')
      },
      {
        path: '/news/newsDetail/update',
        component: () => import('../views/news/NewsDetailUpdateView.vue')
      },
      {
        path: '/news/newsDetail/add-new',
        component: () => import('../views/news/NewsDetailAddNewView.vue')
      },
      {
        path: '/house/second-hand-house/update-1',
        component: () => import('../views/house/SecondHandHouseUpdateInfoView1')
      },
      {
        path: '/house/second-hand-house/update-2',
        component: () => import('../views/house/SecondHandHouseUpdateInfoView2')
      },
      {
        path: '/user',
        component: () => import('../views/user/UserListView')
      },
      {
        path: '/userReservation',
        component: () => import('../views/user/ReservationListView')
      },


    ]
  },
  {
    path: '/login',
    component: () => import('../views/LoginView.vue')
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
